1. Field of the Invention
The present invention relates generally to a language processing system, a language processing method and a storage medium storing a language processing program. More particularly, the invention relates to a language processing system and a language processing method which can reduce a memory region necessary for profile information collection of a computer and can reduce overhead of the profile information collection upon program execution.
2. Description of the Related Art
For improving performance in execution of programs, it is quite effective to know behavior of programs on the basis of profile information. The profile information is information collected by dynamically monitoring times of execution, execution period of a particular portion, branching information and so forth. The profile information thus obtained is used as an analysis information of program. Optimization for improvement of execution speed and so forth is mainly performed on the basis of such profile information. The profile information is useful information enabling specific optimization of the program. Call pair information indicative of call frequency of caller/callee (caller side function/callee side function) in the program is one of such profile information.
Upon collecting profile information, particularly call pair information, there has been known a profile collecting method which reduces overhead cost in the profile information collection and make it constant, and enables calculation of the overhead. (see Japanese Unexamined Patent Publication No. Heisei 9(1997)-62544).
FIG. 10 is a block diagram showing a construction of the conventional profile information collecting system and FIGS. 11A, 11B and 11C are explanatory illustrations of a call pair information generating method in the system shown in FIG. 10.
Discussion will be given hereinafter for conventional profile information collecting method with reference to FIGS. 10 and 11A, 11B, 11C. In a profile process inserting portion 110 shown in FIG. 10, when a function call instruction is present in a source program 140, a source program containing a profiling process is generated by inserting a branching code to the profile information collection immediately before execution of the function call instruction. A compiling and program executing portion 120 executes compiling of the source program including the profile process. When profiling process is executed, a two-dimensional call pair information processing table shown in FIG. 11A is mapped with taking a callerID indicative of caller side function and a calleeID indicative of callee side function as argument to establish a linear call pair information storage table 160 shown in FIG. 11C. Then, calling number of the call pair is incremented by 1. EQU f(caller, callee)=[(caller+callee-1)*(calleer+callee-2)]/2+callee-1 (1)
In FIGS. 11A, ID1, ID2, ID3 and ID4 correspond main routine (labeled as "main"), a function (labeled as "func1"), a function (labeled as "func2") and a function (labeled as "func3"), respectively, as shown in FIG. 11B.
Upon end of program execution, in a profile information generating portion 130, with taking a value mapped according to the foregoing equation (1) as index, number of times of calling per each relevant call pair is read out from the linear table of the call pair information storage table 160. By recording the read out number of times of calling, a call pair information is output.
However, in the conventional profile information collecting method set forth above, in order to enable recording of number of times of calling for all call pair information in the program, necessary memory region has to be preliminarily reserved in a lump.
In this case, in a mutual relationship of all functions contained in the program, since it is possible to cause calling relationship, a two-dimensional table which can store number of times of calling for all possible combination (including call for the function in question per se) of all functions. Therefore, when number of functions contained in the program is large, a huge amount of capacity is required as a region for the table storing call pairs.
Furthermore, a long period is required for initializing process for such large region. Also, it takes a long period for mapping the two-dimensional call pair information storing table mapped in terms of both of the caller and callee in the linear call pair information storage table. Therefore, an overhead in profile process upon execution of the program becomes large. Also, it becomes necessary to derive (map) the index even upon outputting the call pair information to take a long period for such process to further increase the overhead in profile process upon program execution.